package com.sz.service;

import com.sz.dao.UserMapper;
import com.sz.pojo.User;
import java.util.List;

public class UserServiceImpl implements UserService{
    //调用dao层的操作，设置一个set接口，方便Spring管理
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }


    public List<User> alluser() {
        return userMapper.alluser();
    }

    public User findOne(User user) {
        return userMapper.findOne(user);
    }


    public int addOne(User user) {
        return userMapper.addOne(user);
    }


    public User checkReg(String userName) {
        return userMapper.checkReg(userName);
    }

    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    public int deleteUserById(int id) {
        return userMapper.deleteUserById(id);
    }

    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    public User queryBookById(int id) {
        return userMapper.queryBookById(id);
    }

    public List<User> queryAllBook() {
        return userMapper.queryAllBook();
    }

    public User queryUserByName(String userName) {
        return userMapper.queryUserByName(userName);
    }
}
